import { VueShape } from "@antv/x6-vue-shape";
import testnode from "./node.vue";
import { Node } from "@antv/x6";
import {  getGraph } from "../graph-common/graph";
class BaseNode extends VueShape {
  // eslint-disable-next-line class-methods-use-this
  isGroup() {
    return false;
  }
}

class rtNode extends BaseNode {
  getInPorts() {
    return this.getPortsByGroup("in");
  }

  getOutPorts() {
    return this.getPortsByGroup("out");
  }
}
Node.registry.register("rtNode", rtNode);

rtNode.config({
  width: 170,
  height: 36,
  shape: "rtNode",
  textContent:'',
  ports: {
    groups: {
      in: {
        position: { name: "top" },
        attrs: {
          circle: {
            r: 4,
            magnet: true,
            stroke: "#31d0c6",
            strokeWidth: 1,
            fill: "#fff",
           
          },
        },
        zIndex: 2,
      },
      out: {
        position: { name: "bottom" },
        attrs: {
          circle: {
            r: 4,
            magnet: true,
            stroke: "#31d0c6",
            strokeWidth: 1,
            fill: "#fff",
           
          },
        },
        zIndex: 2,
      },
    },
  },
  attrs: {
    body: {
      magnet: true,
      fill: "none",
      stroke: "none",
      refWidth: "100%",
      refHeight: "100%",
      zIndex: 1,
    },
    label:{
      fontSize:'12px',
      overflow:'hidden',
      visibility :'hidden'
    }
  },
  component: {
    components: {
      testnode,
    },
    data(){
      return{
        round:getGraph().isRound
      }
    },
    template: `<testnode :round="round"/>`,
  },
});


export default rtNode